import http from '../http'
import { aiLearnPad, dreamQuestionBank, questionBank } from '../host.js'
const API = {
  getTopic: '/v1/wrong/web/wrong/target',
  getQuestionList: '/v1/question',
  courseListPath: '/v1/config/course/list'
}

export function getTopicList(data) {
  return http.post(aiLearnPad + API.getTopic, data)
}

export function getQuestionList(data) {
  return http.get(
    `${dreamQuestionBank + API.getQuestionList}?page=${data.page}&page_size=${data.page_size}&course_id=${data.course_id}&keypoint=${data.keypoint}`
  )
}

export const getCourseList = params => {
  return http.get(
    questionBank +
      API.courseListPath +
      `?subject=${params.subject}&stage=${params.stage}`
  )
}
